package com.scau.pojo;

import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.subject.SubjectContext;
import org.apache.shiro.web.mgt.DefaultWebSubjectFactory;

@Slf4j
public class JwtDefaultSubjectFactory extends DefaultWebSubjectFactory {

    //每一个请求都会创建一个subject
    @Override
    public Subject createSubject(SubjectContext context) {
        // 不创建 session
        log.info("不创建 session");
        context.setSessionCreationEnabled(false);
        return super.createSubject(context);
    }
}